package com.atguigu.product.feign;

import com.atguigu.product.Product;
import com.atguigu.product.fallback.ProductFeignCilentFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient(value = "service-product", fallback = ProductFeignCilentFallback.class)
public interface ProductFeignClient {
    /**
     * 根据产品id进行查询
     * @param productId
     * @return
     */
    @GetMapping("/api/product/productId/{id}")
    Product getProductId(@PathVariable("id") Long productId);

}
